package com.itheima.test;

import com.itheima.domain.User;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;


public class ID查询 {
    public static void main(String[] args) throws Exception{
        SqlSession sqlSession = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis-conﬁg.xml")).openSession();
        User user = sqlSession.selectOne("UserMapper.selectById", 2);

        System.out.println(user);

        sqlSession.close();


    }
}
